Skip to content

Rewrite to a sphinx project and use unified theme#698

Merged
eteq merged 25 commits intoastropy:mainfrom
Cadair:unified-theme-rewrite
May 6, 2026
Merged

Rewrite to a sphinx project and use unified theme#698
eteq merged 25 commits intoastropy:mainfrom
Cadair:unified-theme-rewrite

Conversation

@Cadair
Copy link
Copy Markdown
Member

@Cadair Cadair commented Jan 19, 2026

You can see a preview of this here: https://astropy-org--698.org.readthedocs.build/

Fun things to checkout:

  • light and dark themes
  • the search!!

I think this is now ready for review, but please confine review to the diff in this PR. i.e. not the theme which should be reviewed here: astropy/astropy-sphinx-theme#48


HTML Pages left to port:

  • announcements/*.html
  • contribute.html
  • credits.html
  • team.html
  • paper1_10k_citations.html

Todo before merge:

  • Find someone with power to move the astropy.org domain to RTD punted to later
  • Be ready to reconfigure Github pages for actions upload
  • Add back Google Analytics, and start a discussion somewhere about improvements later
  • Merge theme PR and release astropy-sphinx-theme

Other potential improvements:

  • Use intersphinx for all links to core documentation
  • See if we can generate a dark theme variant of the home page background

@Cadair Cadair force-pushed the unified-theme-rewrite branch from 4b2fc98 to af49c3f Compare January 19, 2026 16:49
@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 19, 2026

I'll keep a list of things I think we could tidy up here as I go along:

  • We should get rid of all the affiliated package javascript and have sphinx just do all the page gen on build. Then cronjob the site to rebuild each day or week or something.
  • The Copy bibtex js on the citation page inlines all the bibtex which is just horrible, we should have sphinx read that in from somewhere sane. What is the canonical source of the citation bibtex?
  • The javascript for the team page should all be removed and replaced with build-time Python code.

@Cadair Cadair force-pushed the unified-theme-rewrite branch 4 times, most recently from d351274 to d4640ba Compare January 20, 2026 17:17
@Cadair

This comment was marked as outdated.

@Cadair Cadair marked this pull request as ready for review January 20, 2026 17:20
@Cadair Cadair changed the title WIP: Rewrite to a sphinx project and use unified theme Rewrite to a sphinx project and use unified theme Jan 20, 2026
@pllim
Copy link
Copy Markdown
Member

pllim commented Jan 20, 2026

You will have to pull this change in too after it is merged. FYI

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 21, 2026

@astropy/astropy-website-maintainers This is now ready for review.

Comment thread requirements.txt Outdated
sphinx
myst-parser
sphinx-design
astropy-sphinx-theme@git+https://github.com/Cadair/astropy-sphinx-theme@sunpy-astropy-theme
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably cut a release of astropy-sphinx-theme before merging this PR 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pls cross link PR from that branch here for future reference? Thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the PR description above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, nevermind. We cannot merge until this is resolved. I better block merge given the approval.

@pllim
Copy link
Copy Markdown
Member

pllim commented Jan 21, 2026

This is now ready for review

Shouldn't I wait for you to resolve #698 (comment) first?

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 21, 2026

This is now ready for review

Shouldn't I wait for you to resolve #698 (comment) first?

No, I don't think so. This PR is not about the theme it's about rewriting the astropy.org site to use sphinx. Comments about the theme should go on the theme PR.

@hamogu
Copy link
Copy Markdown
Member

hamogu commented Jan 21, 2026

Now for the record: I'm not a maintainer of this repro because I have deep experience with web development, it's because we used to manually update the list of affiliated packages in this repro and I was the affiliated package editor at the time (and are again now, though we know how've a difference mechanism).
@eteq is the person who usually reviews changes like this.

That said, I'll have a look as soon as I can.

Copy link
Copy Markdown
Member

@hamogu hamogu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes are pretty straightforward changes for html->rst. I'm not saying that to diminish @Cadair 's work (I know it's still a lot of work to do that, but it's not conceptually hard), just to say that the review is basically "it works" and there is no need to review every changed line, because we would not want to include any changes in the wording of individual pages here anyway.
Otherwise, it's a pretty standard setup and I see no problems with it.

Comment thread _static/js/functions.js
Comment on lines +3 to +6
// Quirk to note: the jQuery.getJSON function fails if you open this locally
// with Chrome, because Chrome thinks local JSON files are unsafe for some
// reason. Use basically any other modern browser, or it works fine if its
// actually on the web server even with chrome.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really important here, since this is just a comment anyway, but I think most modern browsers now refuse to load any local file for security - for testing locally you'll a local web server running for all or most of them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this comment is pretty old 😆

I'd like to purge this entire file of js if I have the time.

@pllim
Copy link
Copy Markdown
Member

pllim commented Jan 22, 2026

You have to resolve conflict to pick up #699 . Thanks!

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 27, 2026

Merged in main

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 27, 2026

Looks like that's a circleci problem, the way that circleci previews somethings doesn't really work properly. If you look at the RTD preview it seems to work.

@pllim
Copy link
Copy Markdown
Member

pllim commented Jan 27, 2026

Thanks for the clarification. I hope you are right...

@pllim
Copy link
Copy Markdown
Member

pllim commented Jan 27, 2026

So this is good to merge or are we waiting on something else?

Comment thread .circleci/config.yml Outdated
Comment thread exts/rawfiles.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add comment to explain what this is for, for future reference?

Copy link
Copy Markdown
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also... Don't we also use some sort of banner mechanism here that "talks" with astropy cord RTD, like when we announced the 10k citation stuff. Would that still work?

Comment thread requirements.txt Outdated
sphinx
myst-parser
sphinx-design
astropy-sphinx-theme@git+https://github.com/Cadair/astropy-sphinx-theme@sunpy-astropy-theme
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, nevermind. We cannot merge until this is resolved. I better block merge given the approval.

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 27, 2026

So this is good to merge or are we waiting on something else?

There's a todo list in the OP, but mostly it's blocked on people reviewing / approving / arguing about colours on the theme PR.

Copy link
Copy Markdown
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for sunpy theme release

@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Jan 27, 2026

Also... Don't we also use some sort of banner mechanism here that "talks" with astropy cord RTD, like when we announced the 10k citation stuff. Would that still work?

Yes, but I should actually make this site display the banner if it's active!

@Cadair Cadair force-pushed the unified-theme-rewrite branch from b122766 to f18d04b Compare February 5, 2026 16:07
@Cadair
Copy link
Copy Markdown
Member Author

Cadair commented Apr 7, 2026

@eteq I think the latest commit f75fd07 (this PR) adds a workflow which can be configured to publish the built site to github pages.

I think there's still some configuration work to be done to make that actions based deployment work (github actions environment etc).

Copy link
Copy Markdown
Member

@eteq eteq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally happy with all of this, but I have a few questions about finalization steps, @Cadair :

  1. The changes reminded me our release announcements are generally rendered here. I'm not sure how much we're using that in the more recent releases (@astrofrog might know?), but it's possible that some links will be broken by this if e.g. some of them assumed the github url instead of the astropy.org URL?
  2. @Cadair, I'm not sure what the finalization was you had in mind here as your last few posts suggest different things to me: are you thinking to use the gh-actions build to mirror the RTD build to here and have this remain the "true" version? (which would then require no DNS change I think) Or just have this as an alternative build and still update the DNS to point to RTD?

@eteq
Copy link
Copy Markdown
Member

eteq commented May 6, 2026

In some out-of-band discussion, @Cadair clarified the answer is that the desired end-state is RTD only. But we want to take a phased approach since we're not sure what all might break in the transition. So the plan is:

  1. Reconfigure astropy.github.com to build gh-pages from actions (in preperation for merge).
  2. Merge the PR
  3. See that astropy.org continues to work hosted by gh-pages
  4. @eteq updates teh DNS
  5. figure out what we need to do to disable gh-page or if we can't put a placeholder page up

I'll do 1/2 momentarily, and then we'll follow up with the rest elsewhere (since this will be merged by then)

@eteq
Copy link
Copy Markdown
Member

eteq commented May 6, 2026

I believe I have done step 1, so merging now

@eteq eteq merged commit 6962b36 into astropy:main May 6, 2026
6 of 8 checks passed
@eteq
Copy link
Copy Markdown
Member

eteq commented May 6, 2026

One additional step I realized was also needed: disableing the circleci webhook since it's not used post-merge.

@eteq eteq mentioned this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants